<!doctype html>
<html>
<head>
	<meta charset="utf-8">
	<script type="text/javascript" src="/js/main/jquery.js"></script>
<!--	<link rel="stylesheet" href="/js/main/css/comon0.css">-->
	<link rel="stylesheet" href="/layui/css/layui.css" media="all">
	<style>
		.container {
			display: flex;
		}

		.left {
			width: 30%;
			padding: 20px;
		}

		.middle {
			width: 30%;
			padding: 20px;
		}

		.right {
			width: 40%;
			padding: 20px;
		}

		.loading{position:fixed; left:0; top:0; font-size:18px; z-index:100000000;width:100%; height:100%; background:#1a1a1c; text-align:center;}
		.loadbox{position:absolute; width:160px;height:150px; color: #aaa; left:50%; top:50%; margin-top:-100px; margin-left:-75px;}
		.loadbox img{ margin:10px auto; display:block; width:40px;}
	</style>
</head>
<script>
	$(window).load(function(){
		$(".loading").fadeOut()
	})

	/****/
	// $(document).ready(function(){
	// 	var whei=$(window).width()
	// 	$("html").css({fontSize:whei/20})
	// 	$(window).resize(function(){
	// 		var whei=$(window).width()
	// 		$("html").css({fontSize:whei/20})
	// 	});
	// });
</script>
<script type="text/javascript" src="/js/main/echarts.min.js"></script>
<script language="JavaScript" src="/js/main/main.js"></script>
<body>
<div class="loading">
	<div class="loadbox"> <img src="/js/main/picture/loading.gif"> 页面加载中... </div>
</div>

<div class="container">

	<div class="left">
<!--		;border: 1px solid #1AA094;-->
		<div id="echarts_ajxx" style="width: 400px;height: 400px"></div>
		<div id="echarts_jaqk" style="width: 400px;height: 400px;margin-top: 90px"></div>
	</div>
	<div class="middle">
		<div id="echarts_cqyj" style="width: 400px;height: 400px"></div>
		<div id="echarts_cbrk" style="width: 400px;height: 400px;margin-top: 80px"></div>
	</div>
	<div class="right">
		<div id="echarts_jcsr" style="width: 100%;height: 55%"></div>
		<div id="echarts_nknsh" style="width: 400px;height: 400px"></div>
	</div>
</div>
<div id="layerDemo" style="margin-bottom: 0; display: none">
		<div data-method="offset" data-type="rb" id="xxtxInput"
			class="layui-btn layui-btn-normal">
		</div>
</div>

<script src="/layui/layui.all.js" charset="utf-8"></script>
<script src="/js/jquery.min.js"></script>
<script src="/js/core.util.js"></script>
<script>
		
		layui.use('layer', function() {
			var $ = layui.jquery, layer = layui.layer;

			//触发事件
			var active = {
				setTop : function() {
					var that = this;
				},
				offset : function(othis) {
					var type = othis.data('type'), text = othis.text();
					let arr = text.split("-");

					layer.open({
						type : 1,
						offset : type,
						id : 'layerDemo' + type, //防止重复弹出
						content : '<div style="padding: 10px 50px;">'
								+ '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/workrisk/riskPage11&quot;,&quot;11001&quot;,&quot;个人提醒&quot;)")" >提醒事件：' + arr[1]
								+ '条，请处理!</div>'
								+ '<br/>'
								+ '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/workrisk/controlPage11&quot;,&quot;11101&quot;,&quot;个人督办&quot;)">督办事件：' + arr[0]
								+ '条，请处理</div>'
								+ '<br/>'
								+ '<div style="cursor:pointer" onclick="skipOpen(&quot;/index/attention/attentionCase&quot;,&quot;80101&quot;,&quot;关注案件&quot;)">关注事件：0'
								+ '条，请处理!</div>'
								+ '</div>',
								
						btn : '关闭',
						btnAlign : 'c',//按钮居中
						shade : 0,//不显示遮罩
						yes : function() {
							layer.closeAll();
						}
					});
				}
			};

			$('#layerDemo .layui-btn').on('click', function() {
				var othis = $(this), method = othis.data('method');
				active[method] ? active[method].call(this, othis) : '';
			});
			
		});
		$(function() {

			CoreUtil.sendPost("/sys/getXxtx", null, function(res) {
				
				if(res.code == "0"){
					var list = res.data;
					var list0 = list[0]; // 提醒
					var list1 = list[1]; // 督办
					
					$("#xxtxInput").html(list0+"-"+list1);
					
					$('#layerDemo .layui-btn').trigger("click");
				}
				
			})
			
			
			
		})
		
		function skipOpen(gnurl,gnid,title){
			if(CoreUtil.isEmpty(gnurl) || CoreUtil.isEmpty(gnid) || CoreUtil.isEmpty(title)){
				
				return false;
			}else{
				var gnurlArr = gnurl.split(",");
				var gnidArr = gnid.split(",");
				var titleArr = title.split(",");
				for (var i in gnurlArr) {
					tianzhuan(gnurlArr[i],gnidArr[i],titleArr[i])
				}
			}
		}
		
		function tianzhuan(gnurl,gnid,title){
			if ($(".layui-tab-title li[lay-id]").length <= 0) {
				
				var title = "<span>"+title+"</span>";
			    active.tabAdd(gnurl,gnid,title);
				
			} else {
				var isData = false;
				$.each($(".layui-tab-title li[lay-id]"),
					function() {
						if ($(this).attr("lay-id") == dataid.attr("data-id")) {
							isData = true;
						}
				})
				
				if (isData == false) {
					if (CoreUtil.isEmpty(dataid
							.attr("data-icon"))) {
						var title = "<span>"
								+ dataid.attr("data-title")
								+ "</span>";
						active.tabAdd(dataid.attr("data-url"),
								dataid.attr("data-id"), title);
					} else {
						var title = "<span>"
								+ dataid.attr("data-title")
								+ "</span>";
						title = '<i class="layui-icon '
								+ dataid.attr("data-icon")
								+ '"></i> ' + title;
						active.tabAdd(dataid.attr("data-url"),
								dataid.attr("data-id"), title);
					}
				}
			};
			
			active.tabChange(gnid);
		};	
		
		
		//触发事件
		var active = {
			tabAdd : function(url, id, title) {
				if (url != "" && url != null && url != undefined) {
					window.parent.layui.element
							.tabAdd(
									'tab',
									{
										title : title,
										content : '<iframe data-frameid="'
												+ id
												+ '" frameborder="0" name="content" width="100%" src="'
												+ url + '"></iframe>',
										id : id
									})
				}
				FrameWH();//计算框架高度
			},
			tabChange : function(id) {
				//切换到指定Tab项
				window.parent.layui.element.tabChange('tab', id); //切换到：用户管理
				$("iframe[data-frameid='" + id + "']").attr("src",
						$("iframe[data-frameid='" + id + "']").attr("src"))//切换后刷新框架
			},
			/* tabDelete : function(id) {
				element.tabDelete("tab", id);//删除
			} */
		};
		
		
		function FrameWH() {
			var h = $(window).height();
			$(window.parent.document).find("iframe").css("height", h + "px");
		};
		
		
</script>
</body>
</html>
